/* 视频列表页面样式 */
.video-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 60px auto 0; /* 添加上边距，避免被导航栏遮挡 */
    min-height: calc(100vh - 60px); /* 确保列表容器至少占满视口高度减去导航栏高度 */
}

.video-card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-card .video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 宽高比 */
    background: #000;
    overflow: hidden;
}

.video-card .video-thumbnail img,
.video-card .video-thumbnail .video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* 默认隐藏 */
}

.video-card .video-thumbnail img {
    display: block; /* 默认显示图片 */
}

.video-card .video-thumbnail .video-preview {
    background: #000;
}

.video-card .video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 2; /* 确保时长显示在最上层 */
}

.video-card .video-info {
    padding: 1rem;
    background: var(--card-background);
}

.video-card .video-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
}

.video-card .video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.video-card .video-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-card .video-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
}

.video-card .video-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.video-card .video-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.video-card .video-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.5rem;
}

/* 加载动画样式 */
.loading-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误消息样式 */
.error-message {
    color: #ff4444;
    text-align: center;
    padding: 20px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 4px;
    margin: 20px auto;
    max-width: 600px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .video-list {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
        margin-top: 50px; /* 移动端导航栏高度可能不同 */
    }

    .video-card .video-info {
        padding: 0.75rem;
    }

    .video-card .video-title {
        font-size: 0.9rem;
    }

    .video-card .video-meta {
        font-size: 0.8rem;
    }

    .video-card .video-stats {
        font-size: 0.75rem;
    }

    .video-card .video-description {
        font-size: 0.8rem;
    }
}